package com.fangxing.apps.example.jpa;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by fangxing on 17-6-20.
 */
@RestController
public class UserJPAController {
    @Autowired
    UserJPARepository userJPARepository;

    @RequestMapping("/jpauser")
    public User jpaUser(){
        User user = (User) userJPARepository.findByName("fangxing");
        User u = userJPARepository.findById("12314");
        return u;
    }


}
